import requests, unittest


class TestInterface(unittest.TestCase):
    # 测试的初始化
    def setUp(self):
        print("test start")

    # 测试数据正常查询
    def test_dataGet(self):
        url = 'http://127.0.0.1:8000/api/get_event_list/?eid=1'
        r = requests.get(url)
        response = r.json()
        self.assertEqual(response['status'], 200)
        self.assertEqual(response['message'], 'success')

    # 测试的回收-测试的环境还原
    def tearDown(self):
        print("test end")


if __name__ == '__main__':
    unittest.main()
